<?php

namespace common\models\workin_tables;

use Yii;

/**
 * This is the model class for table "{{%idcard_check}}".
 *
 * @property int $id
 * @property string $grant_key
 * @property string $api_key
 * @property string $business_code
 * @property string $name 姓名
 * @property string $id_card 身份证号码
 * @property string $order_report_id 外部唯一标识
 * @property string $search_index
 * @property string $result_detail
 * @property string $result_photo_base64 网纹Base64
 * @property string $result_result 实名一致
 * @property string $result_report_id 唯一标识
 * @property int $result_auth_status 0:一致，1：不一致，2：本数据库中未查的，-1：数据源异常
 * @property double $result_service_fee
 * @property int $result_is_real
 * @property int $result_exp_status
 * @property string $result_busi_code
 * @property string $result_busi_msg
 * @property string $result_extend_data
 */
class IdcardCheck extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%idcard_check}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_workin');
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['grant_key', 'api_key', 'name', 'id_card', 'search_index'], 'required'],
            [['result_detail', 'result_photo_base64', 'result_extend_data'], 'string'],
            [['result_auth_status', 'result_is_real', 'result_exp_status'], 'integer'],
            [['result_service_fee'], 'number'],
            [['grant_key', 'api_key', 'business_code', 'name', 'id_card', 'order_report_id', 'result_result', 'result_report_id', 'result_busi_code', 'result_busi_msg'], 'string', 'max' => 200],
            [['search_index'], 'string', 'max' => 50],
            [['search_index'], 'unique'],
            [['id_card'], 'unique'],
            [['order_report_id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'grant_key' => Yii::t('app', 'Grant Key'),
            'api_key' => Yii::t('app', 'Api Key'),
            'business_code' => Yii::t('app', 'Business Code'),
            'name' => Yii::t('app', '姓名'),
            'id_card' => Yii::t('app', '身份证号码'),
            'order_report_id' => Yii::t('app', '外部唯一标识'),
            'search_index' => Yii::t('app', 'Search Index'),
            'result_detail' => Yii::t('app', 'Result Detail'),
            'result_photo_base64' => Yii::t('app', '网纹Base64'),
            'result_result' => Yii::t('app', '实名一致'),
            'result_report_id' => Yii::t('app', '唯一标识'),
            'result_auth_status' => Yii::t('app', '0:一致，1：不一致，2：本数据库中未查的，-1：数据源异常'),
            'result_service_fee' => Yii::t('app', 'Result Service Fee'),
            'result_is_real' => Yii::t('app', 'Result Is Real'),
            'result_exp_status' => Yii::t('app', 'Result Exp Status'),
            'result_busi_code' => Yii::t('app', 'Result Busi Code'),
            'result_busi_msg' => Yii::t('app', 'Result Busi Msg'),
            'result_extend_data' => Yii::t('app', 'Result Extend Data'),
        ];
    }
}
